import Vue from 'vue';

export const mountedRenderFn = (renderFn, vueInstance) => {
  const instance = new Vue({render: h => renderFn(h, vueInstance)});
  instance.$mount();
  return instance;
};

export const mountedRenderFnGetTemp = (renderFn, data)=>{
  const instance = new Vue({render: h => renderFn(h, data)});
  instance.$mount();
  return instance.$el;
}

export const mountedRenderFnContext = (renderFn, vueInstance,context) => {
  // console.log('mountedRenderFnContext',renderFn,vueInstance,context);
  const instance = new Vue({render: h => renderFn(h, vueInstance,context)});
  instance.$mount();
  return instance;
};
